[Ivy]
[>Created: Fri Jul 04 15:16:23 ICT 2014]
146F4E5711347AAE 3.17 #module
>Proto >Proto Collection #zClass
Gt0 GenerateReport Big #zClass
Gt0 B #cInfo
Gt0 #process
Gt0 @TextInP .resExport .resExport #zField
Gt0 @TextInP .type .type #zField
Gt0 @TextInP .processKind .processKind #zField
Gt0 @AnnotationInP-0n ai ai #zField
Gt0 @TextInP .xml .xml #zField
Gt0 @TextInP .responsibility .responsibility #zField
Gt0 @StartRequest f0 '' #zField
Gt0 @EndTask f1 '' #zField
Gt0 @GridStep f3 '' #zField
Gt0 @PushWFArc f4 '' #zField
Gt0 @CREATE_REPORT_DIALOG_BEAN f5 '' #zField
Gt0 @PushWFArc f6 '' #zField
Gt0 @PushWFArc f2 '' #zField
Gt0 @InfoButton f7 '' #zField
Gt0 @StartRequest f8 '' #zField
Gt0 @EndTask f9 '' #zField
Gt0 @CREATE_REPORT_DIALOG_BEAN f15 '' #zField
Gt0 @PushWFArc f13 '' #zField
Gt0 @PushWFArc f10 '' #zField
Gt0 @PushWFArc f12 '' #zField
Gt0 @GridStep f11 '' #zField
Gt0 @StartRequest f14 '' #zField
Gt0 @EndTask f16 '' #zField
Gt0 @GridStep f18 '' #zField
Gt0 @PushWFArc f19 '' #zField
Gt0 @PushWFArc f17 '' #zField
Gt0 @StartRequest f20 '' #zField
Gt0 @EndTask f21 '' #zField
Gt0 @GridStep f23 '' #zField
Gt0 @PushWFArc f24 '' #zField
Gt0 @CREATE_REPORT_DIALOG_BEAN f27 '' #zField
Gt0 @PushWFArc f25 '' #zField
Gt0 @PushWFArc f22 '' #zField
>Proto Gt0 Gt0 GenerateReport #zField
Gt0 f0 outLink generateReportTest.ivp #txt
Gt0 f0 type attachmentBirtTest.Data #txt
Gt0 f0 inParamDecl '<> param;' #txt
Gt0 f0 actionDecl 'attachmentBirtTest.Data out;
' #txt
Gt0 f0 guid 146F4E5A854C9A8F #txt
Gt0 f0 requestEnabled true #txt
Gt0 f0 triggerEnabled false #txt
Gt0 f0 callSignature generateReportTest() #txt
Gt0 f0 persist false #txt
Gt0 f0 taskData '#
#Wed Jul 02 10:47:27 ICT 2014
TaskTriggered.ROL=Everybody
TaskTriggered.EXTYPE=0
TaskTriggered.EXPRI=2
TaskTriggered.TYPE=0
TaskTriggered.PRI=2
TaskTriggered.EXROL=Everybody
' #txt
Gt0 f0 caseData '#
#Wed Jul 02 10:47:27 ICT 2014
businessCalendarName=
businessCreator.user=
businessMilestone.timestamp=
businessObject.code=
businessObject.docDb.code=
businessObject.folder.id=
businessObject.name=
businessPriority=
businessStart.timestamp=
case.description=
case.name=
correspondent.id=
mainContact.docDb.code=
mainContact.folder.id=
mainContact.id=
mainContact.name=
mainContact.type=
process.code=
process.name=
processCategory.code=
processCategory.name=
subType.code=
subType.name=
type.code=
type.name=
' #txt
Gt0 f0 showInStartList 1 #txt
Gt0 f0 taskAndCaseSetupAction 'import ch.ivyteam.ivy.workflow.TaskUpdateDefinition;
ch.ivyteam.ivy.workflow.TaskUpdateDefinition taskUpdDef = new ch.ivyteam.ivy.workflow.TaskUpdateDefinition();
import ch.ivyteam.ivy.request.impl.DefaultCalendarProxy;
DefaultCalendarProxy calendarProxy = ivy.cal as DefaultCalendarProxy;
taskUpdDef.setPriority(ch.ivyteam.ivy.workflow.WorkflowPriority.valueOf(2));
taskUpdDef.setExpiryActivator("Everybody");
taskUpdDef.setExpiryPriority(ch.ivyteam.ivy.workflow.WorkflowPriority.valueOf(2));
engine.updateCurrentTask(taskUpdDef);
' #txt
Gt0 f0 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>generateReportTest.ivp</name>
        <nameStyle>22,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f0 @C|.responsibility Everybody #txt
Gt0 f0 163 59 26 26 13 0 #rect
Gt0 f0 @|StartRequestIcon #fIcon
Gt0 f1 type attachmentBirtTest.Data #txt
Gt0 f1 163 387 26 26 14 0 #rect
Gt0 f1 @|EndIcon #fIcon
Gt0 f3 actionDecl 'attachmentBirtTest.Data out;
' #txt
Gt0 f3 actionTable 'out=in;
' #txt
Gt0 f3 actionCode '//also specify the place at "birtl.properties" like "designRepository= E:\\_vision\\IvyDesigner\\workspace\\AttachmentBirtTest\\reports\\Testreport"
out.reportUrl = "E:\\_vision\\IvyDesigner\\workspace\\AttachmentBirtTest\\reports\\GenerateTest";

out.reportParams.put("pParameter1","Ich bin Parameter 1");
out.reportParams.put("pParameter2","Ich bin Parameter 2");

//true --> use "session" folder| false (default): use "application" folder
out.reportResultFile = new File("Testbericht.pdf", true);' #txt
Gt0 f3 type attachmentBirtTest.Data #txt
Gt0 f3 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>init data</name>
        <nameStyle>9,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f3 158 156 36 24 20 -2 #rect
Gt0 f3 @|StepIcon #fIcon
Gt0 f4 expr out #txt
Gt0 f4 176 85 176 156 #arcP
Gt0 f5 @AbstractThirdPartyProgramInterface|type attachmentBirtTest.Data #txt
Gt0 f5 @AbstractThirdPartyProgramInterface|timeout 0 #txt
Gt0 f5 @AbstractThirdPartyProgramInterface|beanConfig "in.reportUrl|in.reportResultFile|ch.ivyteam.ivy.extension.birt.OutputFormat.PDF|in.reportParams||" #txt
Gt0 f5 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>generate report</name>
        <nameStyle>15,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f5 158 252 36 24 20 -2 #rect
Gt0 f5 @|CreateReportDialog #fIcon
Gt0 f6 expr out #txt
Gt0 f6 176 180 176 252 #arcP
Gt0 f2 expr out #txt
Gt0 f2 176 276 176 387 #arcP
Gt0 f7 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>reportUrl:  path to report template file (.rptdesign) without extension
reportResultFile: path to generated file ({IvyDesigner}\files\session)</name>
        <nameStyle>142,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f7 284 123 376 42 -183 -16 #rect
Gt0 f7 @|IBIcon #fIcon
Gt0 f7 -4144960|-1|-16777216 #nodeStyle
Gt0 f8 outLink useDatasetTest.ivp #txt
Gt0 f8 type attachmentBirtTest.Data #txt
Gt0 f8 inParamDecl '<> param;' #txt
Gt0 f8 actionDecl 'attachmentBirtTest.Data out;
' #txt
Gt0 f8 guid 146F522522077C44 #txt
Gt0 f8 requestEnabled true #txt
Gt0 f8 triggerEnabled false #txt
Gt0 f8 callSignature useDatasetTest() #txt
Gt0 f8 persist false #txt
Gt0 f8 taskData '#
#Wed Jul 02 10:47:48 ICT 2014
TaskTriggered.ROL=Everybody
TaskTriggered.EXTYPE=0
TaskTriggered.EXPRI=2
TaskTriggered.TYPE=0
TaskTriggered.PRI=2
TaskTriggered.EXROL=Everybody
' #txt
Gt0 f8 caseData '#
#Wed Jul 02 10:47:48 ICT 2014
businessCalendarName=
businessCreator.user=
businessMilestone.timestamp=
businessObject.code=
businessObject.docDb.code=
businessObject.folder.id=
businessObject.name=
businessPriority=
businessStart.timestamp=
case.description=
case.name=
correspondent.id=
mainContact.docDb.code=
mainContact.folder.id=
mainContact.id=
mainContact.name=
mainContact.type=
process.code=
process.name=
processCategory.code=
processCategory.name=
subType.code=
subType.name=
type.code=
type.name=
' #txt
Gt0 f8 showInStartList 1 #txt
Gt0 f8 taskAndCaseSetupAction 'import ch.ivyteam.ivy.workflow.TaskUpdateDefinition;
ch.ivyteam.ivy.workflow.TaskUpdateDefinition taskUpdDef = new ch.ivyteam.ivy.workflow.TaskUpdateDefinition();
import ch.ivyteam.ivy.request.impl.DefaultCalendarProxy;
DefaultCalendarProxy calendarProxy = ivy.cal as DefaultCalendarProxy;
taskUpdDef.setPriority(ch.ivyteam.ivy.workflow.WorkflowPriority.valueOf(2));
taskUpdDef.setExpiryActivator("Everybody");
taskUpdDef.setExpiryPriority(ch.ivyteam.ivy.workflow.WorkflowPriority.valueOf(2));
engine.updateCurrentTask(taskUpdDef);
' #txt
Gt0 f8 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>useDatasetTest.ivp</name>
        <nameStyle>18,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f8 @C|.responsibility Everybody #txt
Gt0 f8 827 43 26 26 15 0 #rect
Gt0 f8 @|StartRequestIcon #fIcon
Gt0 f9 type attachmentBirtTest.Data #txt
Gt0 f9 827 403 26 26 14 0 #rect
Gt0 f9 @|EndIcon #fIcon
Gt0 f15 @AbstractThirdPartyProgramInterface|type attachmentBirtTest.Data #txt
Gt0 f15 @AbstractThirdPartyProgramInterface|timeout 0 #txt
Gt0 f15 @AbstractThirdPartyProgramInterface|beanConfig "in.reportUrl|in.reportResultFile|ch.ivyteam.ivy.extension.birt.OutputFormat.PDF|in.reportParams||" #txt
Gt0 f15 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>generate report</name>
        <nameStyle>15,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f15 822 252 36 24 20 -2 #rect
Gt0 f15 @|CreateReportDialog #fIcon
Gt0 f13 expr out #txt
Gt0 f13 840 276 840 403 #arcP
Gt0 f10 expr out #txt
Gt0 f10 840 180 840 252 #arcP
Gt0 f12 expr out #txt
Gt0 f12 840 69 840 156 #arcP
Gt0 f11 actionDecl 'attachmentBirtTest.Data out;
' #txt
Gt0 f11 actionTable 'out=in;
' #txt
Gt0 f11 actionCode 'import org.apache.commons.io.IOUtils;
import java.io.FileOutputStream;
import ch.soreco.standard.xexpenses.entity.Attachment;
import ch.soreco.standard.xexpenses.service.ServicesHolder;
import ch.soreco.standard.xexpenses.service.AttachmentService;

AttachmentService attachmentService = ServicesHolder.getService(ch.soreco.standard.xexpenses.enums.ServiceName.ATTACHMENT_SERVICE) as AttachmentService;

int expenseHeaderId = 676;

List<Attachment> attList = attachmentService.findByExpenseHeaderId(expenseHeaderId);

java.io.File tempFile = new java.io.File("E:\\ReportFileText.txt");
//convert file to image file
for(Attachment attachment: attList){
	FileOutputStream output = new FileOutputStream(tempFile);
	IOUtils.write(attachment.content, output);
}

String htmlFormat = 
"<div>
	<h1>Hello BIRT report</h1>
	<hr/>
	<p>
		There is some text.
	</p>
	<p style = \"color: green; font-style: italic;\">
		There is some text with style.
	</p>
</div>";

//also specify the place at "birtl.properties" like "designRepository= E:\\_vision\\IvyDesigner\\workspace\\AttachmentBirtTest\\reports\\Testreport"
out.reportUrl = "E:\\_vision\\IvyDesigner\\workspace\\AttachmentBirtTest\\reports\\UseDataSetTest";

out.reportParams.put("attmentList",attList);
out.reportParams.put("htmlFormat",htmlFormat);

//true --> use "session" folder| false (default): use "application" folder
out.reportResultFile = new File("DatasetReport.pdf");' #txt
Gt0 f11 type attachmentBirtTest.Data #txt
Gt0 f11 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>init data</name>
        <nameStyle>9,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f11 822 156 36 24 20 -2 #rect
Gt0 f11 @|StepIcon #fIcon
Gt0 f14 outLink convertToImage.ivp #txt
Gt0 f14 type attachmentBirtTest.Data #txt
Gt0 f14 inParamDecl '<> param;' #txt
Gt0 f14 actionDecl 'attachmentBirtTest.Data out;
' #txt
Gt0 f14 guid 146FA9DAB3DB72E7 #txt
Gt0 f14 requestEnabled true #txt
Gt0 f14 triggerEnabled false #txt
Gt0 f14 callSignature convertToImage() #txt
Gt0 f14 persist false #txt
Gt0 f14 taskData '#
#Thu Jul 03 12:07:15 ICT 2014
TaskTriggered.ROL=Everybody
TaskTriggered.EXTYPE=0
TaskTriggered.EXPRI=2
TaskTriggered.TYPE=0
TaskTriggered.PRI=2
TaskTriggered.EXROL=Everybody
' #txt
Gt0 f14 caseData '#
#Thu Jul 03 12:07:16 ICT 2014
businessCalendarName=
businessCreator.user=
businessMilestone.timestamp=
businessObject.code=
businessObject.docDb.code=
businessObject.folder.id=
businessObject.name=
businessPriority=
businessStart.timestamp=
case.description=
case.name=
correspondent.id=
mainContact.docDb.code=
mainContact.folder.id=
mainContact.id=
mainContact.name=
mainContact.type=
process.code=
process.name=
processCategory.code=
processCategory.name=
subType.code=
subType.name=
type.code=
type.name=
' #txt
Gt0 f14 showInStartList 1 #txt
Gt0 f14 taskAndCaseSetupAction 'import ch.ivyteam.ivy.workflow.TaskUpdateDefinition;
ch.ivyteam.ivy.workflow.TaskUpdateDefinition taskUpdDef = new ch.ivyteam.ivy.workflow.TaskUpdateDefinition();
import ch.ivyteam.ivy.request.impl.DefaultCalendarProxy;
DefaultCalendarProxy calendarProxy = ivy.cal as DefaultCalendarProxy;
taskUpdDef.setPriority(ch.ivyteam.ivy.workflow.WorkflowPriority.valueOf(2));
taskUpdDef.setExpiryActivator("Everybody");
taskUpdDef.setExpiryPriority(ch.ivyteam.ivy.workflow.WorkflowPriority.valueOf(2));
engine.updateCurrentTask(taskUpdDef);
' #txt
Gt0 f14 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>convertToImage.ivp</name>
        <nameStyle>18,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f14 @C|.responsibility Everybody #txt
Gt0 f14 1219 27 26 26 14 0 #rect
Gt0 f14 @|StartRequestIcon #fIcon
Gt0 f16 type attachmentBirtTest.Data #txt
Gt0 f16 1219 419 26 26 14 0 #rect
Gt0 f16 @|EndIcon #fIcon
Gt0 f18 actionDecl 'attachmentBirtTest.Data out;
' #txt
Gt0 f18 actionTable 'out=in;
' #txt
Gt0 f18 actionCode 'import ch.soreco.standard.xexpenses.utils.ThumbnailManager;
import java.io.FileInputStream;
import org.apache.commons.io.FilenameUtils;
import java.util.ArrayList;
import org.apache.commons.io.IOUtils;
import java.io.FileOutputStream;
import ch.soreco.standard.xexpenses.entity.Attachment;
import ch.soreco.standard.xexpenses.service.ServicesHolder;
import ch.soreco.standard.xexpenses.service.AttachmentService;

AttachmentService attachmentService = ServicesHolder.getService(ch.soreco.standard.xexpenses.enums.ServiceName.ATTACHMENT_SERVICE) as AttachmentService;

int expenseHeaderId = 676;

List<Attachment> attList = attachmentService.findByExpenseHeaderId(expenseHeaderId);

java.io.File tempFile = new java.io.File("E:\\ReportFileText.docx");
java.io.File imgFile = new java.io.File("E:\\ReportFileTextThumbnail.bmp");

//convert file to image file
for(Attachment attachment: attList){
	ivy.log.info("--attachment: "+attachment);
	
	FileOutputStream output = new FileOutputStream(tempFile);
	IOUtils.write(attachment.content, output);
	
	ivy.log.info("--tempFile: "+tempFile);
	
	FileInputStream input = new FileInputStream(ThumbnailManager.createThumbnail(tempFile).getFile());
	
	FileOutputStream output1 = new FileOutputStream(imgFile);
	IOUtils.write(IOUtils.toByteArray(input), output1);
	
	ivy.log.info("--imgFile: "+imgFile);
}

tempFile.delete();
imgFile.delete();

String htmlFormat = 
"<div>
	<h1>Hello BIRT report</h1>
	<hr/>
	<p>
		There is some text.
	</p>
	<p style = \"color: green; font-style: italic;\">
		There is some text with style.
	</p>
</div>";

//also specify the place at "birtl.properties" like "designRepository= E:\\_vision\\IvyDesigner\\workspace\\AttachmentBirtTest\\reports\\Testreport"
out.reportUrl = "E:\\_vision\\IvyDesigner\\workspace\\AttachmentBirtTest\\reports\\UseDataSetTest";

out.reportParams.put("attmentList",attList);
out.reportParams.put("htmlFormat",htmlFormat);

//true --> use "session" folder| false (default): use "application" folder
out.reportResultFile = new File("DatasetReport.pdf");' #txt
Gt0 f18 type attachmentBirtTest.Data #txt
Gt0 f18 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>init data</name>
        <nameStyle>9,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f18 1214 164 36 24 20 -2 #rect
Gt0 f18 @|StepIcon #fIcon
Gt0 f19 expr out #txt
Gt0 f19 1232 53 1232 164 #arcP
Gt0 f17 expr out #txt
Gt0 f17 1232 188 1232 419 #arcP
Gt0 f20 outLink attachmentReport.ivp #txt
Gt0 f20 type attachmentBirtTest.Data #txt
Gt0 f20 inParamDecl '<> param;' #txt
Gt0 f20 actionDecl 'attachmentBirtTest.Data out;
' #txt
Gt0 f20 guid 146FF186D277796A #txt
Gt0 f20 requestEnabled true #txt
Gt0 f20 triggerEnabled false #txt
Gt0 f20 callSignature attachmentReport() #txt
Gt0 f20 persist false #txt
Gt0 f20 taskData '#
#Fri Jul 04 08:59:27 ICT 2014
TaskTriggered.ROL=Everybody
TaskTriggered.EXTYPE=0
TaskTriggered.EXPRI=2
TaskTriggered.TYPE=0
TaskTriggered.PRI=2
TaskTriggered.EXROL=Everybody
' #txt
Gt0 f20 caseData '#
#Fri Jul 04 08:59:27 ICT 2014
businessCalendarName=
businessCreator.user=
businessMilestone.timestamp=
businessObject.code=
businessObject.docDb.code=
businessObject.folder.id=
businessObject.name=
businessPriority=
businessStart.timestamp=
case.description=
case.name=
correspondent.id=
mainContact.docDb.code=
mainContact.folder.id=
mainContact.id=
mainContact.name=
mainContact.type=
process.code=
process.name=
processCategory.code=
processCategory.name=
subType.code=
subType.name=
type.code=
type.name=
' #txt
Gt0 f20 showInStartList 1 #txt
Gt0 f20 taskAndCaseSetupAction 'import ch.ivyteam.ivy.workflow.TaskUpdateDefinition;
ch.ivyteam.ivy.workflow.TaskUpdateDefinition taskUpdDef = new ch.ivyteam.ivy.workflow.TaskUpdateDefinition();
import ch.ivyteam.ivy.request.impl.DefaultCalendarProxy;
DefaultCalendarProxy calendarProxy = ivy.cal as DefaultCalendarProxy;
taskUpdDef.setPriority(ch.ivyteam.ivy.workflow.WorkflowPriority.valueOf(2));
taskUpdDef.setExpiryActivator("Everybody");
taskUpdDef.setExpiryPriority(ch.ivyteam.ivy.workflow.WorkflowPriority.valueOf(2));
engine.updateCurrentTask(taskUpdDef);
' #txt
Gt0 f20 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>attachmentReport.ivp</name>
        <nameStyle>20,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f20 @C|.responsibility Everybody #txt
Gt0 f20 1779 67 26 26 14 0 #rect
Gt0 f20 @|StartRequestIcon #fIcon
Gt0 f21 type attachmentBirtTest.Data #txt
Gt0 f21 1779 483 26 26 14 0 #rect
Gt0 f21 @|EndIcon #fIcon
Gt0 f23 actionDecl 'attachmentBirtTest.Data out;
' #txt
Gt0 f23 actionTable 'out=in;
' #txt
Gt0 f23 actionCode 'import ch.soreco.standard.xexpenses.utils.FileConverter;
import java.util.ArrayList;
import ch.soreco.standard.xexpenses.bean.AttachmentReport;
import ch.soreco.standard.xexpenses.bean.ExpenseDetailReport;


//prepare data
List<ExpenseDetailReport> expenseList = new ArrayList<ExpenseDetailReport>(3);
ExpenseDetailReport expense1 = new ExpenseDetailReport(1, "1, 2", "expense type test 1");
ExpenseDetailReport expense2 = new ExpenseDetailReport(2, "1, 3", "expense type test 2");
ExpenseDetailReport expense3 = new ExpenseDetailReport(3, "3", "expense type test 3");
expenseList.add(expense1);
expenseList.add(expense2);
expenseList.add(expense3);

java.io.File wordFile = new java.io.File("E:\\_vision\\work\\Birt report\\TestFile\\Handling ICS files when changing absence type of existing absence.doc");
java.io.File imgFile = new java.io.File("E:\\_vision\\work\\Birt report\\TestFile\\grungy-watercolor-5 orange.jpg");
java.io.File excelFile = new java.io.File("E:\\_vision\\work\\Birt report\\TestFile\\Company trip program_20140401.xlsx");

Array<Byte> wordContent = FileConverter.convertToImgFormat(wordFile);
Array<Byte> imgContent = FileConverter.getContent(imgFile);
Array<Byte> excelContent = FileConverter.convertToImgFormat(excelFile);

List<AttachmentReport> attachmentList = new ArrayList<AttachmentReport>(5);
AttachmentReport attachment1 = new AttachmentReport(1, wordContent);
AttachmentReport attachment2 = new AttachmentReport(1, imgContent);
AttachmentReport attachment3 = new AttachmentReport(2, wordContent);
AttachmentReport attachment4 = new AttachmentReport(2, excelContent);
AttachmentReport attachment5 = new AttachmentReport(3, excelContent);
attachmentList.add(attachment1);
attachmentList.add(attachment2);
attachmentList.add(attachment3);
attachmentList.add(attachment4);
attachmentList.add(attachment5);

//report params
out.reportParams.put("attachmentList",attachmentList);
out.reportParams.put("expenseList",expenseList);

out.reportUrl = "E:\\_vision\\IvyDesigner\\workspace\\AttachmentBirtTest\\reports\\attachment_report";
out.reportResultFile = new File("AttachmentReport.pdf");' #txt
Gt0 f23 type attachmentBirtTest.Data #txt
Gt0 f23 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>prepare data</name>
        <nameStyle>12,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f23 1774 164 36 24 20 -2 #rect
Gt0 f23 @|StepIcon #fIcon
Gt0 f24 expr out #txt
Gt0 f24 1792 93 1792 164 #arcP
Gt0 f27 @AbstractThirdPartyProgramInterface|type attachmentBirtTest.Data #txt
Gt0 f27 @AbstractThirdPartyProgramInterface|timeout 0 #txt
Gt0 f27 @AbstractThirdPartyProgramInterface|beanConfig "in.reportUrl|in.reportResultFile|ch.ivyteam.ivy.extension.birt.OutputFormat.PDF|in.reportParams||" #txt
Gt0 f27 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>generate report</name>
        <nameStyle>15,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Gt0 f27 1774 300 36 24 20 -2 #rect
Gt0 f27 @|CreateReportDialog #fIcon
Gt0 f25 expr out #txt
Gt0 f25 1792 324 1792 483 #arcP
Gt0 f22 expr out #txt
Gt0 f22 1792 188 1792 300 #arcP
>Proto Gt0 .type attachmentBirtTest.Data #txt
>Proto Gt0 .processKind NORMAL #txt
>Proto Gt0 .xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <swimlaneLabel>Generate Report Test</swimlaneLabel>
        <swimlaneLabel>Use Dataset Test</swimlaneLabel>
        <swimlaneLabel>Convert File Test</swimlaneLabel>
        <swimlaneLabel>Attachment Demotration</swimlaneLabel>
        <swimlaneLabel></swimlaneLabel>
    </language>
    <swimlaneSize>672</swimlaneSize>
    <swimlaneSize>392</swimlaneSize>
    <swimlaneSize>448</swimlaneSize>
    <swimlaneSize>584</swimlaneSize>
    <swimlaneColor>-16737997</swimlaneColor>
    <swimlaneColor>-13261</swimlaneColor>
    <swimlaneColor>-16750900</swimlaneColor>
    <swimlaneColor>-3355648</swimlaneColor>
</elementInfo>
' #txt
>Proto Gt0 0 0 32 24 18 0 #rect
>Proto Gt0 @|BIcon #fIcon
Gt0 f0 mainOut f4 tail #connect
Gt0 f4 head f3 mainIn #connect
Gt0 f3 mainOut f6 tail #connect
Gt0 f6 head f5 @AbstractThirdPartyProgramInterface|mainIn #connect
Gt0 f5 @AbstractThirdPartyProgramInterface|mainOut f2 tail #connect
Gt0 f2 head f1 mainIn #connect
Gt0 f8 mainOut f12 tail #connect
Gt0 f12 head f11 mainIn #connect
Gt0 f11 mainOut f10 tail #connect
Gt0 f10 head f15 @AbstractThirdPartyProgramInterface|mainIn #connect
Gt0 f15 @AbstractThirdPartyProgramInterface|mainOut f13 tail #connect
Gt0 f13 head f9 mainIn #connect
Gt0 f14 mainOut f19 tail #connect
Gt0 f19 head f18 mainIn #connect
Gt0 f18 mainOut f17 tail #connect
Gt0 f17 head f16 mainIn #connect
Gt0 f20 mainOut f24 tail #connect
Gt0 f24 head f23 mainIn #connect
Gt0 f27 @AbstractThirdPartyProgramInterface|mainOut f25 tail #connect
Gt0 f25 head f21 mainIn #connect
Gt0 f23 mainOut f22 tail #connect
Gt0 f22 head f27 @AbstractThirdPartyProgramInterface|mainIn #connect
